/*lic*/
#ifndef __MAIN_H__
#define __MAIN_H__

#include "hc32_ll.h"

//#include "lwip/init.h"
//#include "lwip/netif.h"
//#include "lwip/timeouts.h"
//#include "netif/etharp.h"
//#include "lwip/debug.h"
//#include "lwip/dhcp.h"
//#include "lwip/stats.h"
//#include "lwip/memp.h"
//#include "netif/ethernetif.h"
//#include "netif/app_ethernet.h"
//#include "lwipopts.h"

// #include "ML307RDC_Module.h"

#include "BufDef.h"

#include <rtthread.h>

#include <stdbool.h>

#define SDRAM3_POOL_START 0x20040000
#define SDRAM3_POOL_END 0x2004FFFF
#define SDRAM3_VAL_START 0x20050000
#define SDRAM3_VAL_END 0x20057FFF
// ECC
#define SDRAM4_START 0x20058000 
#define SDRAM4_END 0x2005FFFF

// 默认线程优先级
#define THREAD_PRIORITY         16
#define THREAD_STACK_SIZE       512
#define THREAD_TIMESLICE        5

#define USART_BUF_LIST_SIZE 3
#define USART_BUF_SIZE 1536

// 线程检查
extern struct rt_event sys_task_check_event;

// 发送完成解锁信号量。用来解决DMA的异步发送阻塞问题
extern rt_sem_t debug_usart_sem;
extern struct rt_messagequeue debug_usart_mq;
extern char debug_usart_tx_buf[1024];
extern size_t led_busy_times;
// 创建控制台接收邮箱
extern struct rt_messagequeue finsh_usart_mq;

extern char itoa_buf[16];
int itoa(int n, char *str, int zero);
// uint8转bcd字符串
void uint8ToHexString(uint8_t value, char *hex_str);

#endif /* __MAIN_H__ */

/*eof*/
